import { Carousel, Input } from 'antd';
import React, { Component } from 'react';
import styles from './News_message.less';
// import { ScrollBoard } from '@jiaminghi/data-view-react';
import Warning_message from './Warning_message';
import { connect } from 'umi';

class News_message extends Component {
  componentDidMount() {
    // 当页面组件完全的加载完毕触发此生命周期，只会触发一次
    this.modalRef = React.createRef();
    this.displayWarningData();
  }

  displayWarningData() {
    const { dispatch } = this.props;
    dispatch &&
      dispatch({
        type: 'warningManage/getData',
      });
  }

  // displayWarningInformation(value) {
  //   const { dispatch } = this.props
  //   dispatch &&
  //     dispatch({
  //       type: 'warningManage/changeVisible',
  //     })
  //   this.displayRowIndex(value)
  // }

  render() {
    const { warningData, visiable } = this.props;
    return (
      <div style={{ color: '#1890ff', width: '100%', height: '100%' }}>
        {/* <ScrollBoard config={config} style={{ width: '100%', height: '100%' }}
          onClick={() => { this.displayWarningInformation() }} /> */}
        <Warning_message visiable={visiable} ref={this.modalRef} />
        <div style={{ overflow: 'auto', height: '100%' }}>
          <p style={{ color: 'red' }}>{warningData[0]}</p>
          <p style={{ color: 'orange' }}>{warningData[1]}</p>
          <p>{warningData[2]}</p>
        </div>
      </div>
    );
  }
}

export default connect(({ warningManage }) => ({
  visiable: warningManage.visiable,
  warningData: warningManage.warningData,
}))(News_message);
